using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using CSP.Model.CSP;

namespace CSP.DataAccess.Mapping
{
    public class AgeGroupMap : EntityTypeConfiguration<AgeGroup>
    {
        public AgeGroupMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.name)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("AgeGroup");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.orderid).HasColumnName("orderid");
            this.Property(t => t.status).HasColumnName("status");
        }
    }
}
